import request from '@/utils/request'

//统一字典下拉框查询
export function adminDict(params) {
    return request({
        url: `common/v1/adminDict`,
        method: 'get',
        params
    })
}
//查询银盛银行信息
export function getBank(params) {
    return request({
        url: `/entry/v1/fund/ys/bank`,
        method: 'get',
        params
    })
}
//行业类型
export function shopTypeTree(params) {
    return request({
        url: `/merchant/v1/shopTypeTreeAll`,
        method: 'get',
        params
    })
}
//查询连锁总店列表
export function chainList(params) {
    return request({
        url: `/merchant/chain/v1/list`,
        method: 'get',
        params
    })
}
//新增连锁总店（非普通商户升级）
export function addMerchant(data) {
    return request({
        url: '/merchant/chain/v1/',
        method: 'post',
        data
    })
}
//查询连锁总店详情
export function getmerchantDetail(id) {
    return request({
        url: `/merchant/chain/v1/${id}`,
        method: 'get',
    })
}
//更新连锁总店
export function updateMerchant(data) {
    return request({
        url: `/merchant/chain/v1/`,
        method: 'put',
        data
    })
}
//普通商家升级总店
export function upgradeChain(params) {
    return request({
        url: '/merchant/chain/v1/upgradeChain',
        method: 'post',
        params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
    })
}
//重置密码
export function resetPassword(id) {
    return request({
        url: `/merchant/chain/v1/reset/password/${id}`,
        method: 'put',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
    })
}
//查询连锁店铺列表
export function chainshopList(params) {
    return request({
        url: `/merchant/chain/shop/v1/list`,
        method: 'get',
        params
    })
}
//查询连锁子店铺详情
export function chainshopDetail(id) {
    return request({
        url: `/merchant/chain/shop/v1/${id}`,
        method: 'get',
    })
}
//新增连锁子店铺
export function addShop(data) {
    return request({
        url: '/merchant/chain/shop/v1/',
        method: 'post',
        data,
    })
}
//编辑连坐子店铺
export function editMerchant(data) {
    return request({
        url: `/merchant/chain/shop/v1/`,
        method: 'put',
        data
    })
}
//删除连锁子店铺
export function deleteMerchant(id) {
    return request({
        url: `/merchant/chain/shop/v1/${id}`,
        method: 'DELETE',
    })
}

//查询连锁总店通用卡存管比例
export function lookRatio(id) {
    return request({
        url: `/merchant/chain/v1/ratio/${id}`,
        method: 'get',
    })
}

//更新连锁店通用卡比例
export function editRatio(params) {
    return request({
        url: `/merchant/chain/v1/ratio/`,
        method: 'put',
        params
    })
}
//新增连锁子店铺（自定义）
export function saveMerchantShop(data) {
    return request({
        url: '/merchant/chain/shop/v1/saveMerchantShop',
        method: 'post',
        data,
    })
}
//
export function watermarkUploadFile(data) {
    return request({
        url: '/common/v1/watermarkUploadFile',
        method: 'post',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        data,
    })
}

//查询银行城市
export function bankCity() {
    return request({
        url: `/common/v1/bankCity`,
        method: 'get',
    })
}

//查询银行卡支行
export function bankBranch(params) {
    return request({
        url: `/common/v1/bankBranch`,
        method: 'get',
        params
    })
}
//连锁门店申请 - 查询申请列表
export function chainApplyList(params) {
    return request({
        url: `/merchant/chain/shop/apply/v1/list`,
        method: 'get',
        params
    })
}
//连锁门店申请 - 新增连锁门店
export function addChainstore(data) {
    return request({
        url: '/merchant/chain/shop/apply/v1',
        method: 'post',
        data,
    })
}
//营业执照识别接口
export function licenseInfo(params) {
    return request({
        url: `/common/v1/licenseInfo`,
        method: 'get',
        params
    })
}
//身份证识别接口
export function idCardInfo(params) {
    return request({
        url: `/common/v1/idCard`,
        method: 'get',
        params
    })
}
//银行卡识别接口
export function bankInfo(params) {
    return request({
        url: `/common/v1/bank`,
        method: 'get',
        params
    })
}
//连锁门店申请 - 查询连锁门店详情
export function chainDetail(merchantId) {
    return request({
        url: `/merchant/chain/shop/apply/v1/${merchantId}`,
        method: 'get',
    })
}
//连锁门店申请 - 编辑连锁门店
export function editChainstore(data) {
    return request({
        url: `/merchant/chain/shop/apply/v1`,
        method: 'put',
        data
    })
}

//连锁人员 - 查询连锁人员列表
export function chainUserList(params) {
    return request({
        url: `/merchant/chain/user/v1/list`,
        method: 'get',
        params
    })
}
//连锁人员 - 新增连锁人员
export function addChainUser(data) {
    return request({
        url: '/merchant/chain/user/v1/',
        method: 'post',
        data,
    })
}
//连锁人员 - 编辑连锁人员
export function editChainsUser(data) {
    return request({
        url: `/merchant/chain/user/v1/`,
        method: 'put',
        data
    })
}
//连锁人员 -查询连锁店铺下拉框
export function chainusershop(params) {
    return request({
        url: `/merchant/chain/user/v1/shop`,
        method: 'get',
        params
    })
}
//连锁人员 -查询连锁人员详情
export function chainUserDetail(id) {
    return request({
        url: `/merchant/chain/user/v1/${id}`,
        method: 'get',
    })
}
//连锁人员 -修改人员状态
export function editchainUserStatus(id) {
    return request({
        url: `/merchant/chain/user/v1/status/${id}`,
        method: 'put',

    })
}
// 查询银盛银行信息
export function entryV1FuncYSBankBin(params) {
    return request({
        url: '/entry/v1/fund/ys/bank/bin',
        method: 'get',
        params
    })
}


